/**
 * Created by 春旺 on 2017/3/23.
 */
//****************************************************************************************************************
//  ReverseOrder.java     Java Foundations
//
// Demonstrates array index processing.
//*****************************************************************************************************************

import java.util.Scanner;

public class ReverseOrder
{
    //-------------------------------------------------------------------------------------------------------------
    // Reads a list of number from the user, storing them in an
    // array, then prints them in the opposite order.
    //--------------------------------------------------------------------------------------------------------------
    public static void main(String[] args)
    {
        Scanner scan = new Scanner(System.in);

        double[] number = new double[10];

        System.out.println("The size of the array: " + number.length);
        for (int index = 0;index < number.length; index++)
        {
            System.out.print("Enter number " + (index+1) + ":");
            number[index] = scan.nextDouble();
        }
        System.out.println("The number in reverse order:");

        for (int index = number.length-1; index >= 0; index--)
            System.out.print(number[index] + "  ");

    }
}
